<!DOCTYPE html>
<%@page language="java" pageEncoding="utf-8" contentType="text/html; charset=UTF-8"%>
<%
	String ctx = request.getContextPath();
%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据源列表</title>
    <link rel="stylesheet" type="text/css" href="css/basic.css" />
    <link rel="stylesheet" type="text/css" href="css/ui.css" />
    <link rel="stylesheet" type="text/css" href="css/common.css" />
    <!-- 设置JS全局变量  ctx -->
	<script type="text/javascript">
		var ctx = "<%=request.getContextPath()%>";
	</script>
</head>
<body>
    <jsp:include page="head.jsp"></jsp:include>
    <div class="container">
    <jsp:include page="terminal_left.jsp"></jsp:include>
    	<div class="page-content">
            <div id="content-scroll">
                <div class="cont-area clearfix">
                    <i class="fl"></i><span class="fl"><a href="index.jsp">首页</a>&gt;<a href="terminal.jsp">数据源列表</a>&gt;数据源列表</span>
                </div>
                <div class="data-grid">
                    <div class="grid-toolbar">
                        <div class="search-box clearfix">
                            <div class="search-group">
                                <label>数据源名称：</label>
                                <input type="text" name="name" id="j-name" />
                            </div>
                            <div class="search-group">
                                <label>运行状态：</label>
                                <select id="j-status" name="status">
                                    <option value="">全部</option>
                                    <option value="0">等待备份</option>
                                    <option value="1">备份中</option>
                                    <option value="2">错误</option>
                                    <option value="3">成功</option>
                                </select>
                            </div>
                            <div class="search-group">
                                <label>数据源状态：</label>
                                <select id="j-dsStatus" name="dsStatus">
                                    <option value="">全部</option>
                                    <option value="0">启用</option>
                                    <option value="1">停用</option>
                                </select>
                            </div>
                            <div class="search-group">
                                <label>备份方式：</label>
                                <select id="j-backupType" name="backupType">
                                    <option value="">全部</option>
                                    <option value="1">定时备份</option>
                                    <option value="2">手动备份</option>
                                </select>
                            </div>

                            <div class="search-btns">
                                <div class="long-search-btns">
                                    <button class="clearfix btn j-search" type="button"><i class="icos icos-search fl"></i><span class="fl">查询</span></button>
                                    <button class="clearfix btn j-reset" type="button"><i class="icos icos-reset fl"></i><span class="fl">重置</span></button>
                                    <!--<button class="clearfix btn j-advSearch" type="button"><i class="icos icos-level fl"></i><span class="fl">高级查询</span></button>-->
                                </div>
                                <div class="short-search-btns">
                                    <button class="btn" type="button"><i class="icos icos-list"></i></button>
                                    <div class="btns-list">
                                        <ul>
                                            <li><a class="clearfix j-search" href="javascript:;">查询</a></li>
                                            <li><a class="clearfix j-reset" href="javascript:;">重置</a></li>
                                            <!--<li><a class="clearfix j-advSearch" href="javascript:;">高级查询</a></li>-->
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="thead">
                        <table>
                            <tbody>
                                <tr>
                                    <th width="24px"><input class="j-checkAll" type="checkbox"></th>
                                    <th width="100px">数据源类型</th>
                                    <th width="150px">数据源名称</th>
                                    <th width="100px">备份方式</th>
                                    <th width="100px">备份周期</th>
                                    <th width="80px">备份次数</th>
                                    <th width="80px">运行状态</th>
                                    <th width="100px">数据源状态</th>
                                    <th width="200px">创建时间</th>
                                    <th width="200px">下次备份时间</th>
                                    <th width="100px">创建人员</th>
                                    <th width="150px">操作区域</th>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="tbody">
                        <table>
                            <tbody id="j-list">
                            <script type="text/ysmart" data-name="list">
                                <@ yepjs.isArray(DATA) && yepjs.forEach(DATA, function(item, index){ @>
                                <tr data-id="<@=item.id @>">
                                    <td width="24px"><input type="checkbox" data-id="<@=item.id @>" class="j-checkEach" /></td>
                                    <td width="100px"><@=item.dataSourceTypeMap[item.dsType]  @></td>
									<td width="150px"><@=item.name @></td>
									<td width="100px"><@=item.backupTypeMap[item.backupType] @></td>
									<td width="100px"><@=item.dsType==2?"-":item.backupPeriodMap[item.backupPeriod] @></td>
                                    <td width="80px"><@=item.dsType==2?"-":item.count @></td>
									<td width="80px"><@=item.dataSourceRunStatusMap[item.status] @></td>
									<td width="100px"><@=item.datasourceDsStatusMap[item.dsStatus] @></td>
                                    <td width="200px"><@=item.createTimeStr @></td>
									<td width="200px"><@=item.dsType==2?"-":item.nextRunStr @></td>
                                    <td width="100px"><@=item.createUserName @></td>
                                    <td width="150px">
                                        <a href="javascript:;" class="j-admin">查看明细</a>
                                    </td>
                                </tr>
                                <@ }); @>
                            </script>
                            </tbody>
                        </table>
                    </div>
                    <div class="grid-page clearfix" id="j-page">
                        <div class="page-left fl"><span>共<span id="j-totalNum">0</span>条</span></div>
                        <div class="page-right fl">
                            <a href="javascript:;" class="j-page-first">首页</a>
                            <a href="javascript:;" class="j-page-prev">上一页</a>
                            <span>第<input type="text" value="1" class="j-page-cur">页，共<span class="j-page-totalPage">1</span>页</span>
                            <a href="javascript:;" class="j-page-next">下一页</a>
                            <a href="javascript:;" class="j-page-last">尾页</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/ysmart" data-name="sourceDetailTpl">
        <form>
            <div class="form-block">
                <h2>基本信息</h2>
                <div class="row clearfix">
                    <div class="col fl">
                        <label>数据源名称：</label>
                        <span><@=DATA.name @></span>
                    </div>
                    <div class="col fl">
                        <label>创建时间：</label>
                        <span><@=DATA.createTimeStr @></span>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col fl">
                        <label>创建人员：</label>
                        <span><@=DATA.createUserName @></span>
                    </div>
					<div class="col fl">
                        <label>文件路径：</label>
                        <span><@=DATA.root @></span>
                    </div>
                </div>
				<div class="row clearfix">
                    <div class="col fl">
                        <label>数据源类型：</label>
						<span><@=DATA.dataSourceTypeMap[DATA.dsType] @></span>
                    </div>
					<div class="col fl">
                        <label>运行状态： </label>
						<span><@=DATA.dataSourceRunStatusMap[DATA.status] @></span>
                    </div>
                </div>
				<div class="row clearfix">
					<div class="col fl">
                        <label>数据源状态： </label>
						<span><@=DATA.datasourceDsStatusMap[DATA.dsStatus] @></span>
                    </div>
                </div>
            </div>
            <div class="form-block">
                <h2>备份策略</h2>
                <div class="row clearfix">                    
                    <div class="col fl">
                        <label>执行方式：</label>
						<span><@=DATA.backupTypeMap[DATA.backupType] @></span>
                    </div>
					<@ if(DATA.dsType!=2){ @>
					<div class="col fl">
                        <span>从<@=DATA.nextRunStr @>时间点开始，每间隔<@=DATA.backupCycle @></span>
						<span><@=DATA.backupPeriodMap[DATA.backupPeriod] @></span>
                    </div>
					<@ } @>
                </div>
            </div>
        </form>
    </script>
    <script src="js/yep.min.js" type="text/javascript" data-config="YBA.Config.js"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        yepjs.use({
            name: ["jquery", "YBA.Plugin.slimscroll","YBA.Common"],
            callback: function () {

                $('#side-scroll').slimscroll({
                    height:"100%"
                });

                YBA.Common.sidebar();
                YBA.Common.gridWidth();
            }
        });
        yepjs.use({
            name: "YBA.Logic.Terminal.list",
            callback: function () {
                YBA.Logic.Terminal.list();
            }
        });
    </script>
</body>
</html>
